/*
 * Copyright 2007 Stefan Arentz <stefan@arentz.nl>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#import "WebServiceRequest.h"

@implementation WebServiceRequest

@synthesize url = _url, action = _action, version = _version, parameters = _parameters, username = _username, password = _password;

- (id) initWithUrl: (NSURL*) url action: (NSString*) action version: (NSString*) version parameters: (NSDictionary*) parameters
{
	if ((self = [super init]) != nil) {
		self.url = url;
		self.action = action;
		self.version = version;
      self.parameters = parameters;
      self.username = nil;
      self.password = nil;
	}
	return self;
}

- (id) initWithUrl: (NSURL*) url action: (NSString*) action version: (NSString*) version parameters: (NSDictionary*) parameters username: (NSString*) username password: (NSString*) password
{
	if ((self = [super init]) != nil) {
		self.url = url;
		self.action = action;
		self.version = version;
      self.parameters = parameters;
      self.username = username;
      self.password = password;
	}
	return self;
}

+ (id) webServiceRequestWithUrl: (NSURL*) url action: (NSString*) action version: (NSString*) version parameters: (NSDictionary*) parameters
{
   return [[[self alloc] initWithUrl: url action: action version: version parameters: parameters] autorelease];
}

+ (id) webServiceRequestWithUrl: (NSURL*) url action: (NSString*) action version: (NSString*) version parameters: (NSDictionary*) parameters username: (NSString*) username password: (NSString*) password
{
   return [[[self alloc] initWithUrl: url action: action version: version parameters: parameters username: username password: password] autorelease];
}

@end
